home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / vsix60.exe / lha / VERNDEMO.PRG < prev    next >
Text File  |  1991-02-02  |  52KB  |  1,227 lines

  1. * Filename......: VernDemo.Prg
  2. *
  3. * Author........: Vernon E. Six, Jr.
  4. *                 2908 Forest Hollow Lane #2329
  5. *                 Arlington, Texas  76006
  6. *                 Ph: (214) 437-7949 - Voice
  7. *                 Ph: (817) 695-0050 - BBS
  8. *
  9. * Last Update...: Fri  02-01-1991  10:39:21
  10. *
  11. * Notice........: Copyright (c) 1989-90 by Vernon E. Six, Jr.
  12. *                 All Rights Reserved World Wide
  13. *
  14. * Version.......: Clipper Summer 87 & v5.0
  15. *
  16. * Purpose.......: Demonstation program for VERNSIX.LIB
  17.  
  18. *****
  19. * Define variables for VMENU()
  20. *****
  21. PRIVATE al_Avail[70]       && What ones are available?
  22. PRIVATE ac_options[70]     && Character array of options
  23. PRIVATE an_start[10]       && Corresponds to each menu's number of options
  24. PRIVATE an_end[10]         &&  ""
  25. PRIVATE ac_msgs[20]        && Message for bottom of screen (top row of menu)
  26. PRIVATE ac_Title[4]        && Title for menus
  27. PRIVATE n_Title            && Number of lines in title array
  28.  
  29. PRIVATE n_cntr             && Misc use
  30.  
  31. PRIVATE n_top              && Used with GETCOORD demo
  32. PRIVATE n_left             && Used with GETCOORD demo
  33. PRIVATE n_bottom           && Used with GETCOORD demo
  34. PRIVATE n_right            && Used with GETCOORD demo
  35.  
  36. PRIVATE ac_Msg[20]         && For DISPMSG()
  37.  
  38. PRIVATE l_DbfOpen          && .T. if SAMPLE.DBF was opened properly
  39.                          && otherwise .F.
  40.  
  41.  
  42. PRIVATE n_Value
  43. PRIVATE d_Date
  44.  
  45.  
  46. INITVERN()                   && Initialize my library
  47. INITHELP()                   && Open the help files in next work area
  48.  
  49. EXTERNAL HELP                && Help the linker find HELP.PRG
  50. EXTERNAL MAKEHLP             && Help the linker find MAKEHLP.PRG
  51. EXTERNAL GETCOORD
  52.  
  53. SET KEY 28  TO HELP          && <F1>
  54. SET KEY 291 TO MAKEHLP       && <Alt-H>
  55. SET KEY 294 TO FAKELOCK      && <Alt-L>
  56.  
  57. NEWSCRN()
  58.  
  59. *****
  60. *
  61. * I like to indent the GRABSCRN() and PUTSCRN() functions, so I don't forget
  62. * to include a PUTSCRN() for every GRABSCRN()
  63. *
  64. *****
  65.  
  66. SET CURSOR OFF
  67.  
  68. GRABSCRN()
  69.    ac_Msg[1]  = " Vern Six's Clipper ToolBox v6.00     Sat  02-02-1991 "
  70.    ac_Msg[2]  = "                                                      "
  71.    ac_Msg[3]  = "     Copyright (c) 1988-91  by Vernon E. Six, Jr.     "
  72.    ac_Msg[4]  = "            All Rights Reserved World Wide            "
  73.    ac_Msg[5]  = "                                                      "
  74.    ac_Msg[6]  = "                  Vernon E. Six, Jr.                  "
  75.    ac_Msg[7]  = "            2908 Forest Hollow Lane #2329             "
  76.    ac_Msg[8]  = "               Arlington, Texas  75080                "
  77.    ac_Msg[9]  = "              Ph: (214) 437-7949 - VOICE              "
  78.    ac_Msg[10] = "               Ph: (817) 695-0058 - BBS               "
  79.    DISPMSG(ac_Msg,10,"","")
  80.    SET CURSOR OFF
  81.    INKEY(5)
  82. PUTSCRN()
  83.          
  84. GRABSCRN()
  85.    ac_Msg[1]  = "Welcome to the Vern Six Clipper Toolbox!!     "
  86.    ac_Msg[2]  = "                                              "
  87.    ac_Msg[3]  = "What you are about to see is a demonstration  "
  88.    ac_Msg[4]  = "of some of the capabilities made possible via "
  89.    ac_Msg[5]  = "this library.                                 "
  90.    ac_Msg[6]  = "                                              "
  91.    ac_Msg[7]  = "For the most part, you will probably not be   "
  92.    ac_Msg[8]  = "able to see much from just using this demo.   "
  93.    ac_Msg[9]  = "You should look at and STUDY the source code  "
  94.    ac_Msg[10] = "to really get a feel for what is taking place "
  95.    ac_Msg[11] = "in this program and how to access VERNSIX.LIB."
  96.    DISPMSG(ac_Msg,11," Vern Six's Clipper Toolbox v6.00 "," Press any key to continue ")
  97.    INKEY(0)
  98. PUTSCRN()
  99.  
  100. GRABSCRN()
  101.    ac_Msg[1]  = " VERNSIX.LIB comes complete with 34 fully operational "
  102.    ac_Msg[2]  = " functions and procedures that you can add to your    "
  103.    ac_Msg[3]  = " Clipper application with very little effort.         "
  104.    ac_Msg[4]  = "                                                      "
  105.    ac_Msg[5]  = " Each function is described in detail in the file     "
  106.    ac_Msg[6]  = " called VERNSIX.DOC.  To print this file on your      "
  107.    ac_Msg[7]  = " printer, merely issue the following command at the   "
  108.    ac_Msg[8]  = " DOS prompt:                                          "
  109.    ac_Msg[9]  = "                                                      "
  110.    ac_Msg[10] = "    C> COPY VERNSIX.DOC PRN [Return]                  "
  111.    ac_Msg[11] = "                                                      "
  112.    ac_Msg[12] = " In addition to VERNSIX.DOC, a Norton Guides Database "
  113.    ac_Msg[13] = " has been included (VERNSIX.NG).                      "
  114.    DISPMSG(ac_Msg,13,""," Press any key to continue ")
  115.    INKEY(0)
  116. PUTSCRN()
  117.  
  118. GRABSCRN()
  119.    ac_Msg[1]  = "The rest of this demonstration is merely a series of"
  120.    ac_Msg[2]  = "pull-down menus.  You can move from one pull-down   "
  121.    ac_Msg[3]  = "menu to the other, by the use of the left and right "
  122.    ac_Msg[4]  = "arrow keys.  To 'pull a menu down', press [Return]. "
  123.    ac_Msg[5]  = "Once you highlight the function you want to see     "
  124.    ac_Msg[6]  = "demonstrated, simply press [Return].                "
  125.    ac_Msg[7]  = "                                                    "
  126.    ac_Msg[8]  = "Note: Not all functions can be demonstrated from a  "
  127.    ac_Msg[9]  = "'visual perspective'.  In these cases, a dialog     "
  128.    ac_Msg[10] = "window will appear to tell you what is taking place."
  129.    ac_Msg[11] = "                                                    "
  130.    ac_Msg[12] = "Be sure to STUDY VERNDEMO.PRG to see what is taking "
  131.    ac_Msg[13] = "place behind the scenes.                            "
  132.    DISPMSG(ac_Msg,13,"", " Press any key to continue ")
  133.    INKEY(0)
  134. PUTSCRN()
  135.  
  136. *****
  137. * Open SETUP.DBF for database functional demos
  138. *****
  139. SELECT 0
  140. l_DbfOpen = .F.
  141.  
  142. BEGIN SEQUENCE
  143.  
  144.    IF .NOT. OPEN_DBF("SAMPLE")
  145.       GRABSCRN()
  146.          ac_Msg[1] = "  Could not gain access to 'SAMPLE.DBF'  "
  147.          ac_Msg[2] = "                                         "
  148.          ac_Msg[3] = "Database function demonstrations disabled"
  149.          DISPMSG(ac_Msg,3,""," Press any key to continue ")
  150.          SET CURSOR OFF
  151.          INKEY(0)
  152.          SET CURSOR ON
  153.       PUTSCRN()
  154.       USE
  155.       BREAK
  156.    ENDIF
  157.    
  158.    IF .NOT. FILE("SAMPLE"+INDEXEXT())
  159.       IF .NOT. SHOW_NTX("SAMPLE","AUTHORLAST+AUTHORFRST")
  160.          GRABSCRN()
  161.             ac_Msg[1] = "  Could not gain access to 'SAMPLE.DBF'  "
  162.             ac_Msg[2] = "                                         "
  163.             ac_Msg[3] = "Database function demonstrations disabled"
  164.             DISPMSG(ac_Msg,3,""," Press any key to continue ")
  165.             SET CURSOR OFF
  166.             INKEY(0)
  167.             SET CURSOR ON
  168.          PUTSCRN()
  169.          USE
  170.          BREAK
  171.       ENDIF
  172.    ENDIF
  173.  
  174.    SET INDEX TO SAMPLE
  175.  
  176.    *****
  177.    * The database functions (VEDIT(), VPICK(), etc) will be disabled
  178.    * if the following variable isn't set to .T.  And we only set this
  179.    * variable to .T. if the open and index function went smoothly.
  180.    *****
  181.    l_DbfOpen = .T.
  182.  
  183. END SEQUENCE
  184.    
  185. *****
  186. *
  187. * Setup the VMENU() stuff
  188. *
  189. *****
  190.         
  191. *****
  192. * Title array
  193. *****
  194. ac_Title[1] = ""
  195. ac_Title[2] = "CopyRight (c) 1988-91 by Vernon E. Six, Jr."
  196. ac_Title[3] = "All Rights Reserved World Wide"
  197. ac_Title[4] = ""
  198. n_title = 4
  199.  
  200. *****
  201. * Setup the array of available options
  202. *****
  203. FOR n_Cntr = 1 TO 70
  204.    al_Avail[n_Cntr] = .T.
  205. NEXT n_Cntr
  206.  
  207. ******
  208. * Setup the messages for the top row on the VMENU() panel
  209. ******
  210. ac_Msgs[1] = "General Functions"
  211. ac_Msgs[2] = "Functions dealing with the user interface portion of an application"
  212. ac_Msgs[3] = "PRIVATE Area Networking (multi-user) application functions"
  213. ac_Msgs[4] = "Information about building 'context sensitive' help screens"
  214. ac_Msgs[5] = "Functions dealing with normal 'database' operations"
  215. ac_Msgs[6] = "Other functions and information"
  216.  
  217.  
  218. *****
  219. * Define top menu (the one across the top)
  220. *****
  221. an_start[1]    = 1
  222. an_end[1]      = 6
  223. ac_options[1]  = " General "
  224. ac_options[2]  = " Input/Output "
  225. ac_options[3]  = " Network "
  226. ac_options[4]  = " Help "
  227. ac_options[5]  = " Database "
  228. ac_options[6]  = " Other "
  229.  
  230.  
  231. *****
  232. * First pull-down - General
  233. *****
  234. an_start[2]    = 10
  235. an_end[2]      = 12
  236. ac_options[10] = " FSELECT()  "
  237. ac_options[11] = " INITVERN() "
  238. ac_options[12] = " VERNVERS() "
  239.  
  240.  
  241. *****
  242. * Second pull-down - Input/Output
  243. *****
  244. an_start[3]    = 15
  245. an_end[3]      = 30
  246. ac_options[15] = " ASK()      "
  247. ac_options[16] = " ASK2()     "
  248. ac_options[17] = " CENTER()   "
  249. ac_options[18] = " DISPMSG()  "
  250. ac_options[19] = " DOL2STR()  "
  251. ac_options[20] = " DTOT()     "
  252. ac_options[21] = " GETCOLOR() "
  253. ac_options[22] = " GETCOORD   "
  254. ac_options[23] = " GRABSCRN() "
  255. ac_options[24] = " NEWSCRN()  "
  256. ac_options[25] = " NUM2TEXT() "
  257. ac_options[26] = " PUTSCRN()  "
  258. ac_options[27] = " TEXTCOLR() "
  259. ac_options[28] = " VMENU()    "
  260. ac_options[29] = " VWIND()    "
  261. ac_options[30] = " WINDCOLR() "
  262.  
  263.  
  264. *****
  265. * Third pull-down - Network
  266. *****
  267. an_start[4]    = 35
  268. an_end[4]      = 39
  269. ac_options[35] = " FAKELOCK   "
  270. ac_options[36] = " V_APPEND() "
  271. ac_options[37] = " V_FLOCK()  "
  272. ac_options[38] = " V_RLOCK()  "
  273. ac_options[39] = " V_USE()    "
  274.  
  275.  
  276. *****
  277. * Fourth pull-down - Help
  278. *****
  279. an_start[5]    = 45
  280. an_end[5]      = 47
  281. ac_options[45] = " HELP       "
  282. ac_options[46] = " INITHELP() "
  283. ac_options[47] = " MAKEHLP    "
  284.  
  285.  
  286. *****
  287. * Fifth pull-down - Database
  288. *****
  289. an_start[6]    = 50
  290. an_end[6]      = 55
  291. ac_options[50] = " ADD_FLD()  "
  292. ac_options[51] = " OPEN_DBF() "
  293. ac_options[52] = " SHOW_NTX() "
  294. ac_options[53] = " VEDIT()    "
  295. ac_options[54] = " VFILT()    "
  296. ac_options[55] = " VPICK()    "
  297.  
  298.  
  299. *****
  300. * Sixth pull-down - Other
  301. *****
  302. an_start[7]    = 60
  303. an_end[7]      = 63
  304. ac_options[60] = " Color settings       "
  305. ac_options[61] = " A special thanks...  "
  306. ac_options[62] = " Ordering Information "
  307. ac_options[63] = " Quit                 "
  308.  
  309. *****
  310. * Start at the top line with no "pull-downs" pulled down
  311. *****
  312. gn_pulldown = 0
  313. gn_option   = 0
  314. SET WRAP ON
  315.  
  316. DO WHILE .T.
  317.  
  318.    n_opt = VMENU(ac_options,an_start,an_end,ac_msgs,ac_title,n_title,al_Avail)
  319.  
  320.    DO CASE
  321.  
  322.       CASE n_opt = 10   && FSELECT()
  323.          ac_Msg[1] = " FSELECT()  allows  you to  query  the  user for  a "
  324.          ac_Msg[2] = " filename matching a  wildcard specification.   The "
  325.          ac_Msg[3] = " user  will  be able  to move  a  light bar  to the "
  326.          ac_Msg[4] = " filename that he/she wishes to select.             "
  327.          ac_Msg[5] = " ══════════════════════════════════════════════════ "
  328.          ac_Msg[6] = " Select a file from the list on the right.          "
  329.          DISPMSG(ac_Msg,6," FSELECT() ","",5,1)
  330.          c_choice = FSELECT("*.*",5,60,15,"","")
  331.          IF .NOT. EMPTY(c_choice)
  332.             ac_Msg[1] = " You selected " + c_choice
  333.             DISPMSG(ac_Msg,1,"","")
  334.             INKEY(3)
  335.          ENDIF
  336.  
  337.       CASE n_opt = 11   && INITVERN()
  338.          ac_Msg[1] = " INITVERN()  initializes  the  variables  used  by  the "
  339.          ac_Msg[2] = " various  functions  in this  library  as well  as sets "
  340.          ac_Msg[3] = " the colors from the  configuration database or creates "
  341.          ac_Msg[4] = " the configuration database if it doesn't exist.        "
  342.          DISPMSG(ac_Msg,4," INITVERN() "," Press any key to continue ")
  343.          INKEY(0)
  344.  
  345.       CASE n_Opt = 12   && VERNVERS()
  346.          ac_Msg[1] = " VERNVERS() is used structly to indentify  which  version "
  347.          ac_Msg[2] = " of the library you are using.  The author of VERNSIX.LIB "
  348.          ac_Msg[3] = " will need this information should you call for technical "
  349.          ac_Msg[4] = " support."
  350.          DISPMSG(ac_Msg,4," VERNVERS() "," Press any key to continue ")
  351.          INKEY(0)
  352.  
  353.       CASE n_opt = 15   && ASK()
  354.          ac_Msg[1] = " ASK() prompts  the user with a  one line question. "
  355.          ac_Msg[2] = " ASK() will return  a one character  response which "
  356.          ac_Msg[3] = " can be  limited to specific characters.   ASK() is "
  357.          ac_Msg[4] = " non-screen destructive.                            "
  358.          ac_Msg[5] = " ══════════════════════════════════════════════════ "
  359.          ac_Msg[6] = " Press any key to see a demonstration of ASK()      "
  360.          DISPMSG(ac_Msg,6," ASK() ", "")
  361.          INKEY(0)
  362.          c_choice = ASK("DEMO: Do you want to continue","YyNn")
  363.  
  364.       CASE n_opt = 16   && ASK2()
  365.          ac_Msg[1] = " ASK2()  prompts  the  user with  a  multiple  line "
  366.          ac_Msg[2] = " question.    ASK2() will  return  a one  character "
  367.          ac_Msg[3] = " response   which  can   be  limited   to  specific "
  368.          ac_Msg[4] = " characters.  ASK2() is non-screen destructive.     "
  369.          ac_Msg[5] = " ══════════════════════════════════════════════════ "
  370.          ac_Msg[6] = " Press any key to see a demonstration of ASK2()     "
  371.          DISPMSG(ac_Msg,6," ASK2() ", "")
  372.          INKEY(0)
  373.          ac_Msg[1] = "DEMO: This is line one of the multi-line question"
  374.          ac_Msg[2] = "DEMO: Do you want to continue"
  375.          c_choice = ASK2(ac_Msg,2,"","","YyNn")
  376.  
  377.       CASE n_opt = 17   && CENTER()
  378.          ac_Msg[1] = " CENTER() allows  you to  center a string  within a "
  379.          ac_Msg[2] = " given width.                                       "
  380.          DISPMSG(ac_Msg,2," CENTER() ", " Press any key to continue ")
  381.          INKEY(0)
  382.  
  383.       CASE n_opt = 18   && DISPMSG()
  384.          ac_Msg[1] = " Displays a  message in  a window (centered  on the "
  385.          ac_Msg[2] = " screen).  The programmer  can supply optional  top "
  386.          ac_Msg[3] = " left coordinates for the window.  This  message is "
  387.          ac_Msg[4] = " being displayed by DISPMSG().                      "
  388.          DISPMSG(ac_Msg,4," DISPMSG() " , " Press any key to continue ")
  389.          INKEY(0)
  390.  
  391.       CASE n_Opt = 19   && DOL2STR()
  392.          ac_Msg[1] = " DOL2STR() takes a numeric amount (similar to that on most "
  393.          ac_Msg[2] = " checks) and  converts it to a 'long-hand'  representation "
  394.          ac_Msg[3] = " of that number."
  395.          ac_Msg[4] = " ═════════════════════════════════════════════════════════ "
  396.          ac_Msg[5] = " Press any key to see a demonstration of DOL2STR()         "
  397.          DISPMSG(ac_Msg,5," DOL2STR() ", "")
  398.          INKEY(0)
  399.  
  400.          NEWSCRN()
  401.          VWIND(11,10,13,60," DOL2STR() ","")
  402.          n_Value = 0.00
  403.          SET CURSOR ON
  404.          @ 12,12 SAY "Please enter a numeric amount:" GET n_Value
  405.          READ
  406.          SET CURSOR OFF
  407.  
  408.          NEWSCRN()
  409.          ac_Msg[1] = "Your number was..."
  410.          ac_Msg[2] = DOL2STR(n_Value)
  411.          DISPMSG(ac_Msg,2," DOL2STR() "," Press any key to continue ")
  412.          INKEY(0)
  413.                        
  414.       CASE n_Opt = 20   && DTOT()
  415.          ac_Msg[1] = " DTOT() converts a date expression to a specific "
  416.          ac_Msg[2] = " character format.  The programmer can request a "
  417.          ac_Msg[3] = " specific format to convert to.                  "
  418.          ac_Msg[4] = " i.e. Month Date, Year (January 28, 1991) or     "
  419.          ac_Msg[5] = "      Date Mon Year    (28 JAN 91)               "
  420.          ac_Msg[6] = " ═══════════════════════════════════════════════ "
  421.          ac_Msg[7] = " Press any key to see a demonstration of DTOT()  "
  422.          DISPMSG(ac_Msg,7," DTOT() ", "")
  423.          INKEY(0)
  424.  
  425.          NEWSCRN()
  426.          VWIND(11,10,13,60," DTOT() ","")
  427.          d_Date = DATE()
  428.          SET CURSOR ON
  429.          @ 12,12 SAY "Please enter a date:" GET d_Date
  430.          READ
  431.          SET CURSOR OFF
  432.  
  433.          NEWSCRN()
  434.          ac_Msg[1] = "Your date converts to...                      "
  435.          ac_Msg[2] = "Style #1: " + DTOT(d_Date,1)
  436.          ac_Msg[3] = "Style #2: " + DTOT(d_Date,2)
  437.          DISPMSG(ac_Msg,3," DTOT() "," Press and key to continue ")
  438.          INKEY(0)
  439.  
  440.  
  441.       CASE n_opt = 21   && GETCOLOR()
  442.          ac_Msg[1] = " Prompts  the user  for the  various color  schemes "
  443.          ac_Msg[2] = " (text and  windowed) that  he/she wants to  use in "
  444.          ac_Msg[3] = " your program.                                      "
  445.          ac_Msg[4] = " ══════════════════════════════════════════════════ "
  446.          ac_Msg[5] = " Press any key to see a demonstration of GETCOLOR() "
  447.          DISPMSG(ac_Msg,5," GETCOLOR() ", "")
  448.          INKEY(0)
  449.          GETCOLOR()
  450.  
  451.       CASE n_opt = 22   && GETCOORD()
  452.          GRABSCRN()
  453.             ac_Msg[01] = " Allows  the  user to  size  a  box on  the  screen "
  454.             ac_Msg[02] = " through  the  use  of  the  cursor  control  keys. "
  455.             ac_Msg[03] = " Returns the top,left and bottom,right  coordinates "
  456.             ac_Msg[04] = " to your program.                                   "
  457.             DISPMSG(ac_Msg,4," GETCOORD() ", " Press any key to continue ")
  458.             INKEY(0)
  459.          PUTSCRN()
  460.  
  461.          GRABSCRN()
  462.             ac_Msg[01] = " When this procedure  is called you will  see a box "
  463.             ac_Msg[02] = " appear on the screen  (at the starting coordinates "
  464.             ac_Msg[03] = " you  specified).  The cursor will  be in the upper "
  465.             ac_Msg[04] = " left hand corner  of the  box.  You  may move  the "
  466.             ac_Msg[05] = " corner around  the  screen  by  using  the  cursor "
  467.             ac_Msg[06] = " control keys.                                      "
  468.             DISPMSG(ac_Msg,6," GETCOORD() ", " Press any key to continue ")
  469.             INKEY(0)
  470.          PUTSCRN()
  471.  
  472.          GRABSCRN()
  473.             ac_Msg[01] = " If you press the [HOME] key, the cursor will  move "
  474.             ac_Msg[02] = " from the upper left corner of the box to the lower "
  475.             ac_Msg[03] = " right corner.  You can now move this corner of the "
  476.             ac_Msg[04] = " box around the screen  by using the cursor control "
  477.             ac_Msg[05] = " keys.   Pressing  the [HOME]  key will  once again "
  478.             ac_Msg[06] = " place the cursor  in the upper left corner  of the "
  479.             ac_Msg[07] = " box.                                               "
  480.             ac_Msg[08] = "                                                    "
  481.             ac_Msg[09] = " When  the box is the  size and is  in the location "
  482.             ac_Msg[10] = " you want, press the [RETURN] key.                  "
  483.             ac_Msg[11] = " ══════════════════════════════════════════════════ "
  484.             ac_Msg[12] = " Press any key to see a demonstration of GETCOORD() "
  485.             DISPMSG(ac_Msg,12," GETCOORD() ", "")
  486.             INKEY(0)
  487.             n_top    = 5
  488.             n_left   = 10
  489.             n_bottom = 20
  490.             n_right  = 70
  491.             DO GETCOORD WITH n_top, n_left, n_bottom, n_right
  492.          PUTSCRN()
  493.  
  494.       CASE n_opt = 23   && GRABSCRN()
  495.          ac_Msg[01] = " Captures contents of the screen  (including cursor "
  496.          ac_Msg[02] = " location, screen attributes,  etc.) to be  used in "
  497.          ac_Msg[03] = " conjunction with PUTSCRN(). "
  498.          ac_Msg[04] = " "
  499.          ac_Msg[05] = " Clipper's  SAVE SCREEN  command doesn't  quite fit "
  500.          ac_Msg[06] = " the bill  for most  screen save operations.   i.e. "
  501.          ac_Msg[07] = " it  doesn't save  the  cursor  position or  screen "
  502.          ac_Msg[08] = " attributes.   GRABSCRN() saves all these important "
  503.          ac_Msg[09] = " aspects  of  your  screen and  will  restore  them "
  504.          ac_Msg[10] = " properly when you call PUTSCRN(). "
  505.          DISPMSG(ac_Msg,10," GRABSCRN() ", " Press any key to continue ")
  506.          INKEY(0)
  507.  
  508.       CASE n_Opt = 24   && NEWSCRN()
  509.          ac_Msg[1] = " NEWSCRN() is a quick and dirty little function to "
  510.          ac_Msg[2] = " clear the screen and paint a 'pretty' background. "
  511.          ac_Msg[3] = " NEWSCRN()  makes  a  call  to  TEXTCOLR()  before "
  512.          ac_Msg[4] = " returning to your calling program."
  513.          DISPMSG(ac_Msg,4," NEWSCRN() ", " Press any key to continue ")
  514.          INKEY(0)
  515.  
  516.  
  517.       CASE n_Opt = 25   && NUM2TEXT()
  518.          ac_Msg[1] = " NUM2TEXT() converts a numeric value to a character "
  519.          ac_Msg[2] = " value.   i.e. 123 becomes One-Hundred Twenty Three "
  520.          ac_Msg[3] = " NUM2TEXT() is  very similar to DOL2STR() but  does "
  521.          ac_Msg[4] = " not  format  the  return  string  to  'dollars and "
  522.          ac_Msg[5] = " cents'.                                            "
  523.          DISPMSG(ac_Msg,5," NUM2TEXT() ", " Press any key to continue ")
  524.          INKEY(0)
  525.  
  526.       CASE n_opt = 26   && PUTSCRN()
  527.          ac_Msg[01] = " Restores a screen captured with GRABSCRN() "
  528.          DISPMSG(ac_Msg,1," PUTSCRN() ", " Press any key to continue ")
  529.          INKEY(0)
  530.  
  531.       CASE n_opt = 27   && TEXTCOLR()
  532.          ac_Msg[01] = " Sets color to normal text colors as defined by the "
  533.          ac_Msg[02] = " configuration database.  You can change the colors "
  534.          ac_Msg[03] = " via the GETCOLOR() function. "
  535.          DISPMSG(ac_Msg,3," TEXTCOLR() ", " Press any key to continue ")
  536.          INKEY(0)
  537.  
  538.       CASE n_opt = 28   && VMENU()
  539.          ac_Msg[01] = " Provides  the  programmer with  a  very  fast  and "
  540.          ac_Msg[02] = " efficient means of producing 'pull-down' menus for "
  541.          ac_Msg[03] = " their users.  VMENU() is screen destructive. "
  542.          ac_Msg[04] = " "
  543.          ac_Msg[05] = " The menu used during this demonstration program was "
  544.          ac_Msg[06] = " created with VMENU(). "
  545.          DISPMSG(ac_Msg,6," VMENU() ", " Press any key to continue ")
  546.          INKEY(0)
  547.  
  548.       CASE n_opt = 29   && VWIND()
  549.          ac_Msg[01] = " Draws  a window  with optional  shadow, color  and "
  550.          ac_Msg[02] = " custom box "
  551.          ac_Msg[03] = " "
  552.          ac_Msg[04] = " All the windows you see during  this demonstration "
  553.          ac_Msg[05] = " have been created with VWIND(). "
  554.          DISPMSG(ac_Msg,5," VWIND() ", " Press any key to continue ")
  555.          INKEY(0)
  556.  
  557.       CASE n_opt = 30   && WINDCOLR()
  558.          ac_Msg[01] = " Sets color  to windowed text colors  as defined by "
  559.          ac_Msg[02] = " the  configuration database.  You  can  change the "
  560.          ac_Msg[03] = " colors via the GETCOLOR() function. "
  561.          DISPMSG(ac_Msg,3," WINDCOLR() ", " Press any key to continue ")
  562.          INKEY(0)
  563.  
  564.       CASE n_opt = 35   && FAKELOCK
  565.          ac_Msg[01] = " Simulates  a  global  network  lock   for  runtime "
  566.          ac_Msg[02] = " testing  of logic  associated  with  network  file "
  567.          ac_Msg[03] = " operations. "
  568.          ac_Msg[04] = " "
  569.          ac_Msg[05] = " FAKELOCK will force all of the VERNSIX.LIB network "
  570.          ac_Msg[06] = " functions   (V_APPEND(),   V_FLOCK(),   V_RLOCK(), "
  571.          ac_Msg[07] = " V_USE()) to act as  though they were unsuccessful. "
  572.          ac_Msg[08] = " This is  useful for  testing your program  code to "
  573.          ac_Msg[09] = " recover  from  such  failures. "
  574.          DISPMSG(ac_Msg,9," FAKELOCK ", " Press any key to continue ")
  575.          INKEY(0)
  576.  
  577.       CASE n_opt = 36   && V_APPEND()
  578.          ac_Msg[01] = " Adds a blank record to the currently selected file "
  579.          ac_Msg[02] = " or notifies user if unsuccessful. "
  580.          ac_Msg[03] = " "
  581.          ac_Msg[04] = " V_APPEND() will  try to  append a blank  record to "
  582.          ac_Msg[05] = " the   currently   selected   file.     If   it  is "
  583.          ac_Msg[06] = " unsuccessful,  a  non-screen  destructive  message "
  584.          ac_Msg[07] = " stating 'Waiting for busy  network.  Press any key "
  585.          ac_Msg[08] = " to  abort.'   will  appear  on   the  screen   and "
  586.          ac_Msg[09] = " V_APPEND() will  continue to endlessly  attempt to "
  587.          ac_Msg[10] = " append  a blank  record to the  currently selected "
  588.          ac_Msg[11] = " database.   If  the user  aborts the  operation by "
  589.          ac_Msg[12] = " pressing a key, V_APPEND()  will return a  logical "
  590.          ac_Msg[13] = " value of  false. If V_APPEND() returns  a value of "
  591.          ac_Msg[14] = " false, its your job as the programmer to abort the "
  592.          ac_Msg[15] = " operation and recover properly. "
  593.          DISPMSG(ac_Msg,15," V_APPEND() ", " Press any key to continue ",5)
  594.          INKEY(0)
  595.  
  596.       CASE n_opt = 37   && V_FLOCK()
  597.          ac_Msg[01] = " Locks the currently selected  file or notifies the "
  598.          ac_Msg[02] = " user if unsuccessful. "
  599.          ac_Msg[03] = " "
  600.          ac_Msg[04] = " V_FLOCK() will try to lock  the currently selected "
  601.          ac_Msg[05] = " file.     If  it  is  unsuccessful,  a  non-screen "
  602.          ac_Msg[06] = " destructive  message  stating  'Waiting  for  busy "
  603.          ac_Msg[07] = " network.   Press any key to abort.' will appear on "
  604.          ac_Msg[08] = " the   screen  and   V_FLOCK()  will   continue  to "
  605.          ac_Msg[09] = " endlessly attempt  to lock the  currently selected "
  606.          ac_Msg[10] = " database.   If  the user  aborts the  operation by "
  607.          ac_Msg[11] = " pressing a key,  V_FLOCK() will  return a  logical "
  608.          ac_Msg[12] = " value of  false. If  V_FLOCK() returns a  value of "
  609.          ac_Msg[13] = " false, its your job as the programmer to abort the "
  610.          ac_Msg[14] = " operation and recover properly. "
  611.          DISPMSG(ac_Msg,14," V_FLOCK() ", " Press any key to continue ",5)
  612.          INKEY(0)
  613.  
  614.       CASE n_opt = 38   && V_RLOCK()
  615.          ac_Msg[01] = " Locks  the currently  selected record  or notifies "
  616.          ac_Msg[02] = " the user if unsuccessful. "
  617.          ac_Msg[03] = " "
  618.          ac_Msg[04] = " V_RLOCK() will try to lock  the currently selected "
  619.          ac_Msg[05] = " record.   If  it  is  unsuccessful,  a  non-screen "
  620.          ac_Msg[06] = " destructive  message  stating  'Waiting  for  busy "
  621.          ac_Msg[07] = " network.   Press any key to abort.' will appear on "
  622.          ac_Msg[08] = " the   screen  and   V_RLOCK()  will   continue  to "
  623.          ac_Msg[09] = " endlessly attempt  to lock the  currently selected "
  624.          ac_Msg[10] = " database.   If  the user  aborts the  operation by "
  625.          ac_Msg[11] = " pressing a key,  V_RLOCK() will  return a  logical "
  626.          ac_Msg[12] = " value of  false. If  V_RLOCK() returns a  value of "
  627.          ac_Msg[13] = " false, its your job as the programmer to abort the "
  628.          ac_Msg[14] = " operation and recover properly. "
  629.          DISPMSG(ac_Msg,14," V_RLOCK() ", " Press any key to continue ",5)
  630.          INKEY(0)
  631.  
  632.       CASE n_opt = 39   && V_USE()
  633.          ac_Msg[01] = " Opens a file in the  current work area or notifies "
  634.          ac_Msg[02] = " the user if  unsuccessful.  The  file can have  an "
  635.          ac_Msg[03] = " ALIAS specified as well as EXCLUSIVE use set on or "
  636.          ac_Msg[04] = " off. "
  637.          DISPMSG(ac_Msg,4," V_USE() ", " Press any key to continue ")
  638.          INKEY(0)
  639.  
  640.       CASE n_opt = 45   && HELP
  641.          ac_Msg[01] = " HELP provides a non-screen-destructive help screen "
  642.          ac_Msg[02] = " based  on the  calling program and  variable name. "
  643.          ac_Msg[03] = " Help screens  can be added  at any time  after the "
  644.          ac_Msg[04] = " program  is  compiled,  through  the  use  of  the "
  645.          ac_Msg[05] = " MAKEHLP   procedure   and   are  fully   'context' "
  646.          ac_Msg[06] = " sensitive.  To see a demo of HELP press F1 at  any "
  647.          ac_Msg[07] = " menu selection. "
  648.          DISPMSG(ac_Msg,7," HELP ", " Press any key to continue ")
  649.          INKEY(0)
  650.  
  651.       CASE n_opt = 46   && INITHELP()
  652.          ac_Msg[01] = " This function  creates  the necessary  HELP  files "
  653.          ac_Msg[02] = " (DBF,  DBT and  N?X)  in the  next available  work "
  654.          ac_Msg[03] = " area. "
  655.          DISPMSG(ac_Msg,3," INITHELP() ", " Press any key to continue ")
  656.          INKEY(0)
  657.  
  658.       CASE n_opt = 47   && MAKEHLP
  659.          GRABSCRN()
  660.             ac_Msg[01] = " Allows the developer to design a help screen after "
  661.             ac_Msg[02] = " the application is compiled. "
  662.             ac_Msg[03] = " "
  663.             ac_Msg[04] = " When this  routine is called,  you will see  a box "
  664.             ac_Msg[05] = " appear on  the screen.   You should  size the  box "
  665.             ac_Msg[06] = " using the technique described in GETCOORD. "
  666.             ac_Msg[07] = " "
  667.             ac_Msg[08] = " When you have a box that is suitable for your help "
  668.             ac_Msg[09] = " window,  press [RETURN].   At  this point  you may "
  669.             ac_Msg[10] = " edit  the help  text as  you wish.   When  you are "
  670.             ac_Msg[11] = " done, press Ctrl-W. "
  671.             DISPMSG(ac_Msg,11," MAKEHLP ", " Press any key to continue ",5)
  672.             INKEY(0)
  673.          PUTSCRN()
  674.  
  675.          GRABSCRN()
  676.             ac_Msg[01] = " To  see a demonstration of  MAKEHLP,  create a text "
  677.             ac_Msg[02] = " file  called VERNSIX.DVP in the  current  directory "
  678.             ac_Msg[03] = " and then press ALT-H while VERNDEMO.EXE is running. "
  679.             DISPMSG(ac_Msg,3," MAKEHLP ", " Press any key to continue ",5)
  680.             INKEY(0)
  681.          PUTSCRN()
  682.  
  683.       CASE n_opt = 50   && ADD_FLD()
  684.          ac_Msg[1] = " ADD_FLD() adds a field to a 'structure extended' database. "
  685.          ac_Msg[2] = " ADD_FLD() saves  you from  having to issue several  APPEND "
  686.          ac_Msg[3] = " BLANKS and REPLACE  statements  when creating a 'structure "
  687.          ac_Msg[4] = " extended' database."
  688.          DISPMSG(ac_Msg,4," ADD_FLD() ", " Press any key to continue ")
  689.          INKEY(0)
  690.  
  691.       CASE n_opt = 51   && OPEN_DBF()
  692.          ac_Msg[1] = " OPEN_DBF() uses a database dictionary to open a specified "
  693.          ac_Msg[2] = " database and all its associated index  files.  OPEN_DBF() "
  694.          ac_Msg[3] = " is primarily used to  allow  several  different  database "
  695.          ac_Msg[4] = " applications to  access  common  databases  and  maintain "
  696.          ac_Msg[5] = " common index files without having to re-compile and  link "
  697.          ac_Msg[6] = " each application."
  698.          DISPMSG(ac_Msg,6," OPEN_DBF() ", " Press any key to continue ")
  699.          INKEY(0)
  700.  
  701.       CASE n_opt = 52   && SHOW_NTX()
  702.          GRABSCRN()
  703.             ac_Msg[01] = " Provides   the   programmer   with  a   non-screen "
  704.             ac_Msg[02] = " desctructuve 'gas guage' type of chart to show the "
  705.             ac_Msg[03] = " user  what  percentage of  the index  operation is "
  706.             ac_Msg[04] = " complete. "
  707.             DISPMSG(ac_Msg,4," SHOW_NTX() ", " Press any key to continue ")
  708.             INKEY(0)
  709.          PUTSCRN()
  710.  
  711.          GRABSCRN()
  712.             ac_Msg[01] = " One of the biggest disadvantages of Clipper is the "
  713.             ac_Msg[02] = " inability   to  show  the  progress  of  an  index "
  714.             ac_Msg[03] = " operation.   While it can be argued  that the hard "
  715.             ac_Msg[04] = " drive access light is  sufficient to tell the user "
  716.             ac_Msg[05] = " that something is happening, a far  greater number "
  717.             ac_Msg[06] = " of users will  argue to  the contrary.   In  fact, "
  718.             ac_Msg[07] = " several users have been  known to turn the machine "
  719.             ac_Msg[08] = " off  while   in  the  middle  of   a  large  index "
  720.             ac_Msg[09] = " operation.  SHOW_NTX()  provides  a  user-friendly "
  721.             ac_Msg[10] = " 'gas gauge'  type  of  display  telling  the  user "
  722.             ac_Msg[11] = " exactly how things are progressing.                "
  723.             ac_Msg[12] = " ══════════════════════════════════════════════════ "
  724.             ac_Msg[13] = " Press any key to see a demonstration of SHOW_NTX()   "
  725.             DISPMSG(ac_Msg,13," SHOW_NTX() ", "",5)
  726.             INKEY(0)
  727.          PUTSCRN()
  728.  
  729.          SHOW_NTX("SAMPLE","AUTHORLAST+AUTHORFRST")
  730.  
  731.          *****
  732.          * SHOW_NTX() acts just like "INDEX ON" in that it locks the database
  733.          * so we need the following code to UNLOCK it
  734.          *****
  735.          BEGIN SEQUENCE
  736.             IF .NOT. V_USE("SAMPLE",.F.)
  737.                GRABSCRN()
  738.                ac_Msg[1] = "Could not gain access to 'SAMPLE.DBF'"
  739.                ac_Msg[2] = "                                     "
  740.                ac_Msg[3] = "          Program aborted!           "
  741.                DISPMSG(ac_Msg,3,""," Press any key to continue ")
  742.                INKEY(0)
  743.                PUTSCRN()
  744.                BREAK
  745.             ENDIF
  746.             SET INDEX TO SAMPLE
  747.          END SEQUENCE
  748.  
  749.       CASE n_opt = 53   && VEDIT()
  750.          ac_Msg[01] = " Emulates the dBASE III+ 'Edit' command by allowing "
  751.          ac_Msg[02] = " the  user  to  page  back and  forth  through  the "
  752.          ac_Msg[03] = " database  records  and   optionally  editing   the "
  753.          ac_Msg[04] = " selected record. "
  754.          ac_Msg[05] = " "
  755.          ac_Msg[06] = " VEDIT() is  very useful for working  with a 'flat' "
  756.          ac_Msg[07] = " database.  VEDIT() controls  all the moving around "
  757.          ac_Msg[08] = " inside your database  and will handle  SEEKs based "
  758.          ac_Msg[09] = " on a pressed key, etc. "
  759.          ac_Msg[10] = " ══════════════════════════════════════════════════ "
  760.          ac_Msg[11] = " Press any key to see a demonstration of VEDIT() "
  761.          DISPMSG(ac_Msg,11," VEDIT() ", "",5)
  762.          INKEY(0)
  763.          DO VEDITDEMO
  764.  
  765.       CASE n_opt = 54   && VFILT()
  766.          GRABSCRN()
  767.             ac_Msg[01] = " Provides  a non-screen-destructive  user interface "
  768.             ac_Msg[02] = " to  allow  the user  to select  a list  of fields, "
  769.             ac_Msg[03] = " logical connectives, and comparison constants from "
  770.             ac_Msg[04] = " pop up light bar windows. "
  771.             ac_Msg[05] = " "
  772.             ac_Msg[06] = " VFILT() draws information from  the database  open "
  773.             ac_Msg[07] = " in the work  area  currently selected  when  it is "
  774.             ac_Msg[08] = " invoked. "
  775.             DISPMSG(ac_Msg,8," VFILT() ", " Press any key to continue ")
  776.             INKEY(0)
  777.          PUTSCRN()
  778.  
  779.          GRABSCRN()
  780.             ac_Msg[01] = " VFILT()  is  designed to  provide  the uninitiated "
  781.             ac_Msg[02] = " user   with   an   easy  interface   to   'filter' "
  782.             ac_Msg[03] = " specification   building.      It    is   database "
  783.             ac_Msg[04] = " independent  and limits  the choices  available in "
  784.             ac_Msg[05] = " the light  bar menus to those  that are applicable "
  785.             ac_Msg[06] = " to  the  variable  type  selected.   As  the  user "
  786.             ac_Msg[07] = " selects    fields,   relational    operators   and "
  787.             ac_Msg[08] = " comparison constants, the string VFILT() builds is "
  788.             ac_Msg[09] = " also displayed on the screen. "
  789.             DISPMSG(ac_Msg,9," VFILT() ", " Press any key to continue ")
  790.             INKEY(0)
  791.          PUTSCRN()
  792.  
  793.          GRABSCRN()
  794.             ac_Msg[01] = " VFILT() alone is not  a powerful function but when "
  795.             ac_Msg[02] = " combined with the macro  substitution capabilities "
  796.             ac_Msg[03] = " of Clipper,  the two become very  powerful indeed. "
  797.             ac_Msg[04] = " The string  returned by  VFILT()  is suitable  for "
  798.             ac_Msg[05] = " macro substitution in the SET FILTER TO command as "
  799.             ac_Msg[06] = " well  as in any FOR  clause in any Clipper command "
  800.             ac_Msg[07] = " supporting  that  clause  (such as  REPORT,  SORT, "
  801.             ac_Msg[08] = " COPY, LIST, etc..). "
  802.             DISPMSG(ac_Msg,8," VFILT() ", " Press any key to continue ")
  803.             INKEY(0)
  804.          PUTSCRN()
  805.  
  806.          GRABSCRN()
  807.             ac_Msg[01] = " A demonstration of VFILT() can be found within the "
  808.             ac_Msg[02] = " VEDIT() demonstration."
  809.             DISPMSG(ac_Msg,2," VFILT() ", " Press any key to continue ")
  810.             INKEY(0)
  811.          PUTSCRN()
  812.  
  813.       CASE n_opt = 55   && VPICK()
  814.          ac_Msg[01] = " Allows the user to  select a record from currently "
  815.          ac_Msg[02] = " selected database. "
  816.          ac_Msg[03] = " ══════════════════════════════════════════════════ "
  817.          DISPMSG(ac_Msg,2," VPICK() ", " Press any key to see a demo of VPICK() ")
  818.          INKEY(0)
  819.          DO VPICKDEMO
  820.  
  821.       CASE n_Opt = 60   && Color settings
  822.          GETCOLOR()
  823.          TEXTCOLR()     && Reflect changes in color settings
  824.  
  825.       CASE n_opt = 61   && Special Thanks
  826.          ac_Msg[01] = " A  special note  of  thanks is due to my  very good "
  827.          ac_Msg[02] = " friend Frank  Grubbs, for his never ending support. "
  828.          ac_Msg[03] = " If  it weren't for Frank's  continuing  testing and "
  829.          ac_Msg[04] = " support, this library would have never left my den. "
  830.          DISPMSG(ac_Msg,4,""," Press any key to continue ")
  831.          INKEY(0)
  832.  
  833.       CASE n_opt = 62   && Ordering Information
  834.          GRABSCRN()
  835.             ac_Msg[01] = " If you purchased VERNSIX.LIB  directly from FrontLine Software in "
  836.             ac_Msg[02] = " your  own name for $39.95,  then your copy  is already registered "
  837.             ac_Msg[03] = " and you will  receive all the  benefits of registration.   You do "
  838.             ac_Msg[04] = " not need to send in a registration form. "
  839.             ac_Msg[05] = " "
  840.             ac_Msg[06] = " If  you received  VERNSIX.LIB  from a  'Users' Group',  'Software "
  841.             ac_Msg[07] = " Library',  'SIG', 'Bulletin Board', etc.   and have  paid a small "
  842.             ac_Msg[08] = " fee (usually either yearly dues or $3.00 to $10.00  per disk) you "
  843.             ac_Msg[09] = " have NOT acquired a registration.   The fee you paid was  for the "
  844.             ac_Msg[10] = " convenience  of obtaining  the diskette  with VERNSIX.LIB  on it. "
  845.             ac_Msg[11] = " The fee does NOT apply to the registration fee. "
  846.             DISPMSG(ac_Msg,11,""," Press any key to continue ",5)
  847.             INKEY(0)
  848.          PUTSCRN()
  849.  
  850.          GRABSCRN()
  851.             ac_Msg[01] = " If you received  an evaluation copy of VERNSIX.LIB from FrontLine "
  852.             ac_Msg[02] = " Software   for  a  fee  of   $5.00,  you  have   NOT  acquired  a "
  853.             ac_Msg[03] = " registration.   The  $5.00 you  paid was  for the  convenience of "
  854.             ac_Msg[04] = " obtaining  the diskette  with VERNSIX.LIB on  it.   However, this "
  855.             ac_Msg[05] = " $5.00 fee DOES  apply toward  your registration fee  and you  may "
  856.             ac_Msg[06] = " deduct it from the $39.95 fee when you register. "
  857.             ac_Msg[07] = " "
  858.             ac_Msg[08] = " You may register your copy by filling out the enclosed  form  and "
  859.             ac_Msg[09] = " mailing it to the listed  address along with your check  or money "
  860.             ac_Msg[10] = " order for $39.95 (Texas residents add 8% sales tax). "
  861.             DISPMSG(ac_Msg,10,""," Press any key to continue ",5)
  862.             INKEY(0)
  863.          PUTSCRN()
  864.  
  865.          GRABSCRN()
  866.             ac_Msg[01] = " When  you register your copy of VERNSIX.LIB, you will receive the "
  867.             ac_Msg[02] = " latest version without the ten second 'advertisemnet' in it.  You "
  868.             ac_Msg[03] = " will  also  be granted  a royalty  free  run-time license  to use "
  869.             ac_Msg[04] = " VERNSIX.LIB in any of your applications. "
  870.             DISPMSG(ac_Msg,4,""," Press any key to continue ")
  871.             INKEY(0)
  872.          PUTSCRN()
  873.  
  874.       CASE n_opt = 63   && Quit
  875.          IF ASK("Are you sure","YyNn") $ "Yy"
  876.             SET CURSOR ON
  877.             TEXTCOLR()
  878.             CLEAR
  879.             QUIT
  880.          ENDIF
  881.  
  882.    ENDCASE
  883.  
  884. ENDDO
  885.  
  886. RETURN
  887. *** EOF: VERNDEMO.PRG *******************************************************
  888.  
  889.  
  890.                ************************************************
  891.                ************************************************
  892.                **                                            **
  893.                ** Supporting procedures and functions follow **
  894.                **                                            **
  895.                ************************************************
  896.                ************************************************
  897.  
  898.  
  899. PROCEDURE VPICKDEMO
  900. *****
  901. * Demonstration of VPICK()
  902. *****
  903. PRIVATE c_FldList, n_retval
  904.  
  905.    TEXTCOLR()
  906.    CLEAR
  907.  
  908.    SET FILTER TO
  909.    GO TOP
  910.  
  911.    c_FldList = "AUTHORLAST + [ ] + AUTHORFRST + [ ] + SUBSTR(TITLE,1,15)"
  912.  
  913.    DO WHILE .T.
  914.  
  915.       gn_StartRec = RECNO()  && What record to start on?
  916.       n_retval = VPICK(5,5,15,c_FldList," VPICK() Demo ","",.T.)
  917.  
  918.       DO CASE
  919.  
  920.          CASE n_RetVal = 22       && [Insert]
  921.             APPEND BLANK
  922.             PICKEDIT()
  923.  
  924.          CASE n_RetVal = 13       && [Return]
  925.             PICKEDIT()
  926.  
  927.          CASE n_retval = 27       && [Esc]
  928.             EXIT
  929.  
  930.          CASE n_retval = 28       && F1
  931.             DO HELP WITH "VPICKDEMO",10,"KEY"
  932.  
  933.          CASE n_retval = 291      && ALT-H
  934.             DO MAKEHLP WITH "VPICKDEMO",10,"KEY"
  935.  
  936.       ENDCASE
  937.  
  938.    ENDDO
  939.  
  940. RETURN
  941. *** EOF: VPICKDEMO **********************************************************
  942.  
  943.  
  944. PROCEDURE PICKEDIT
  945. *****
  946. * Editing procedure for VPICKDEMO
  947. *****
  948. PRIVATE c_temp
  949.  
  950.    TEXTCOLR()
  951.    CLEAR
  952.    @ 01,00 say [╒══════════════════════════════════════════════════════════════════════════════╕]
  953.    @ 02,00 say [│                           Sample Library Database                            │]
  954.    @ 03,00 say [╞══════════════════════════════════════════════════════════════════════════════╡]
  955.    @ 04,00 say [│ About the author...                                                          │]
  956.    @ 05,00 say [│  Last Name:                        First Name:                               │]
  957.    @ 06,00 say [│                                                                              │]
  958.    @ 07,00 say [│ About the book...                                                            │]
  959.    @ 08,00 say [│      Title:                                                                  │]
  960.    @ 09,00 say [│  Sub-Title:                                                                  │]
  961.    @ 10,00 say [│                                                                              │]
  962.    @ 11,00 say [│  Publisher:                                 City, St:                        │]
  963.    @ 12,00 say [│                                                                              │]
  964.    @ 13,00 say [│       Year:            Class:                       Location:                │]
  965.    @ 14,00 say [│                                                                              │]
  966.    @ 15,00 say [│  Comments...                                                                 │]
  967.    @ 16,00 say [│                                                                              │]
  968.    @ 17,00 say [│                                                                              │]
  969.    @ 18,00 say [│                                                                              │]
  970.    @ 19,00 say [│                                                                              │]
  971.    @ 20,00 say [╞══════════════════════════════════════════════════════════════════════════════╡]
  972.    @ 21,00 SAY "│ F1   - Help         End   - End of line  ^T - Del word    Del  - Del Char    │"
  973.    @ 22,00 SAY "│ ESC  - Abort Edit   ^Home - First field  ^Y - Del to EOL  Ins  - Insert      │"
  974.    @ 23,00 SAY "│ Home - Beg of line  ^End  - Last field   ^U - Ooops       PgDn - Save        │"
  975.    @ 24,00 say [╘══════════════════════════════════════════════════════════════════════════════╛]
  976.  
  977.  
  978.    IF RECNO() <= LASTREC()
  979.       c_temp="Record # "+LTRIM( STR(RECNO()) )
  980.       IF DELETED()
  981.          c_temp=c_temp+[*]
  982.        ELSE
  983.          c_temp=c_temp+[ ]
  984.       ENDIF
  985.       c_temp=c_temp+" of "+LTRIM( STR(RECCOUNT()) )+"      "
  986.       @ 02,02 SAY c_temp
  987.             
  988.       @ 05,14 get AUTHORLAST
  989.       @ 05,49 get AUTHORFRST
  990.       @ 05,65 get AUTHORMID
  991.       @ 08,14 get TITLE
  992.       @ 09,14 get SUBTITLE
  993.       @ 11,14 get PUBLISHER
  994.       @ 11,56 get CITYSTATE
  995.       @ 13,14 get YEAR
  996.       @ 13,32 get CLASS
  997.       @ 13,64 get LOCATION
  998.       @ 16,04 get COMMENT1
  999.       @ 17,04 get COMMENT2
  1000.       @ 18,04 get COMMENT3
  1001.  
  1002.     ELSE
  1003.  
  1004.       c_temp = "No records in database"
  1005.       GO BOTTOM
  1006.       SKIP
  1007.       @ 02,02 SAY c_temp
  1008.  
  1009.    ENDIF
  1010.  
  1011.    SET CURSOR ON
  1012.    READ
  1013.    SET CURSOR OFF
  1014.  
  1015. RETURN
  1016. *** EOF: PICKEDIT() *********************************************************
  1017.  
  1018.  
  1019. PROCEDURE VEDITDEMO
  1020. *****
  1021. * Demonstrate VEDIT() use
  1022. *****
  1023. PRIVATE c_Filter, n_RetVal, ac_Msg[4]
  1024.  
  1025.    TEXTCOLR()
  1026.    CLEAR
  1027.  
  1028.  
  1029.    c_Filter = ""
  1030.    SET FILTER TO
  1031.    GO TOP
  1032.  
  1033.    DISPTEXT()        && Display normal text "shell"
  1034.          
  1035.    DO WHILE .T.
  1036.  
  1037.       DISPCURR()     && Display the current record
  1038.  
  1039.       gn_StartRec = RECNO()
  1040.       n_RetVal    = VEDIT(.T.)
  1041.  
  1042.       DO CASE
  1043.  
  1044.          CASE n_RetVal = 13       && [Return]
  1045.             EDITCURR()
  1046.  
  1047.          CASE n_RetVal = 22       && [Insert]
  1048.             IF .NOT. V_APPEND()
  1049.                ac_Msg[1] = " Could not append a blank record "
  1050.                ac_Msg[2] = "      Please try again later     "
  1051.                DISPMSG(ac_Msg,2,"","")
  1052.                SET CURSOR OFF
  1053.                INKEY(5)
  1054.              ELSE
  1055.                EDITCURR()
  1056.             ENDIF
  1057.  
  1058.          CASE n_RetVal = 7   && [Delete]
  1059.             IF .NOT. V_RLOCK()
  1060.                ac_Msg[1] = " Could not lock record  "
  1061.                ac_Msg[2] = " Please try again later "
  1062.                DISPMSG(ac_Msg,2,"","")
  1063.                SET CURSOR OFF
  1064.                INKEY(5)
  1065.              ELSE
  1066.                IF DELETED()
  1067.                   RECALL
  1068.                 ELSE
  1069.                   DELETE
  1070.                ENDIF
  1071.             ENDIF
  1072.  
  1073.          CASE n_RetVal = 27       && [Esc]
  1074.             EXIT
  1075.  
  1076.          CASE n_RetVal = 28       && F1
  1077.             DO HELP WITH "VIEWSAMP",10,"KEY"
  1078.  
  1079.          CASE n_RetVal = 291      && ALT-H
  1080.             DO MAKEHLP WITH "VIEWSAMP",10,"KEY"
  1081.  
  1082.          CASE n_RetVal = -9       && F10   Change colors
  1083.             GETCOLOR()
  1084.             TEXTCOLR()
  1085.             CLEAR
  1086.             DISPTEXT()            && Reflect changes in color settings
  1087.  
  1088.          CASE n_RetVal = -8       && F9    Selectively retrieve records
  1089.             c_Filter = VFILT()
  1090.             IF .NOT. EMPTY(c_Filter)
  1091.                SET FILTER TO &c_Filter
  1092.              ELSE
  1093.                SET FILTER TO
  1094.             ENDIF
  1095.  
  1096.  
  1097.       ENDCASE
  1098.  
  1099.    ENDDO
  1100.  
  1101.    SET FILTER TO
  1102.  
  1103. RETURN
  1104. *** EOF: VEDITDEMO **********************************************************
  1105.  
  1106.  
  1107. FUNCTION DISPTEXT
  1108. *****
  1109. * Draws original screen for VEDIT() (the "text shell")
  1110. *****
  1111.    TEXTCOLR()
  1112.    CLEAR
  1113.    @ 01,00 say [╒══════════════════════════════════════════════════════════════════════════════╕]
  1114.    @ 02,00 say [│                           Sample Library Database                            │]
  1115.    @ 03,00 say [╞══════════════════════════════════════════════════════════════════════════════╡]
  1116.    @ 04,00 say [│ About the author...                                                          │]
  1117.    @ 05,00 say [│  Last Name:                        First Name:                               │]
  1118.    @ 06,00 say [│                                                                              │]
  1119.    @ 07,00 say [│ About the book...                                                            │]
  1120.    @ 08,00 say [│      Title:                                                                  │]
  1121.    @ 09,00 say [│  Sub-Title:                                                                  │]
  1122.    @ 10,00 say [│                                                                              │]
  1123.    @ 11,00 say [│  Publisher:                                 City, St:                        │]
  1124.    @ 12,00 say [│                                                                              │]
  1125.    @ 13,00 say [│       Year:            Class:                       Location:                │]
  1126.    @ 14,00 say [│                                                                              │]
  1127.    @ 15,00 say [│  Comments...                                                                 │]
  1128.    @ 16,00 say [│                                                                              │]
  1129.    @ 17,00 say [│                                                                              │]
  1130.    @ 18,00 say [│                                                                              │]
  1131.    @ 19,00 say [│                                                                              │]
  1132.    @ 20,00 say [╞══════════════════════════════════════════════════════════════════════════════╡]
  1133.    @ 21,00 SAY "│                                                                              │"
  1134.    @ 22,00 SAY "│                                                                              │"
  1135.    @ 23,00 SAY "│                                                                              │"
  1136.    @ 24,00 say [╘══════════════════════════════════════════════════════════════════════════════╛]
  1137.    CLEAR GETS
  1138. RETURN(.T.)
  1139. *** EOF: DISPTEXT() *********************************************************
  1140.                  
  1141.  
  1142. FUNCTION DISPCURR
  1143. *****
  1144. * Display current record
  1145. *****
  1146.    TEXTCOLR()
  1147.    @ 02,61 SAY "*** View Mode ***"
  1148.  
  1149.    DISPFLDS()     && Eliminates redudant code
  1150.  
  1151.    @ 21,00 SAY "│ Esc - Exit     F10  - Colors     Home  - First   Rtrn - Edit                 │"
  1152.    @ 22,00 SAY "│ F1  - Help     PgDn - Next       End   - Last    Del  - Delete               │"
  1153.    @ 23,00 SAY "│ F9  - Filter   Pgup - Previous   Alpha - Seek    Ins  - Append               │"
  1154.  
  1155.    CLEAR GETS
  1156.    SET CURSOR OFF
  1157.  
  1158. RETURN(.T.)
  1159. *** EOF: VIEWSAMP ***********************************************************
  1160.  
  1161.  
  1162. FUNCTION EDITCURR
  1163. *****
  1164. * Edit current record
  1165. *****
  1166.    TEXTCOLR()
  1167.    @ 02,61 SAY "*** Edit Mode ***"
  1168.  
  1169.    DISPFLDS()     && Eliminates redudant code
  1170.  
  1171.    @ 21,00 SAY "│ F1   - Help         End   - End of line  ^T - Del word    Del  - Del Char    │"
  1172.    @ 22,00 SAY "│ ESC  - Abort Edit   ^Home - First field  ^Y - Del to EOL  Ins  - Insert      │"
  1173.    @ 23,00 SAY "│ Home - Beg of line  ^End  - Last field   ^U - Ooops       PgDn - Save        │"
  1174.  
  1175.    SET CURSOR ON
  1176.    READ
  1177.    SET CURSOR OFF
  1178.  
  1179. RETURN(.T.)
  1180. *** EOF: EDITSAMP ***********************************************************
  1181.  
  1182.  
  1183. FUNCTION DISPFLDS
  1184. *****
  1185. * Common "@ SAY ... GET" routine for VIEW and EDIT modes
  1186. *****
  1187.  
  1188. PRIVATE c_temp
  1189.    TEXTCOLR()
  1190.  
  1191.    IF RECNO() <= LASTREC()
  1192.       c_temp="Record # "+LTRIM( STR(RECNO()) )
  1193.       IF DELETED()
  1194.          c_temp=c_temp+[*]
  1195.        ELSE
  1196.          c_temp=c_temp+[ ]
  1197.       ENDIF
  1198.       c_temp=c_temp+" of "+LTRIM( STR(RECCOUNT()) )+"      "
  1199.       @ 02,02 SAY c_temp
  1200.  
  1201.       @ 05,14 get AUTHORLAST
  1202.       @ 05,49 get AUTHORFRST
  1203.       @ 05,65 get AUTHORMID
  1204.       @ 08,14 get TITLE
  1205.       @ 09,14 get SUBTITLE
  1206.       @ 11,14 get PUBLISHER
  1207.       @ 11,56 get CITYSTATE
  1208.       @ 13,14 get YEAR
  1209.       @ 13,32 get CLASS
  1210.       @ 13,64 get LOCATION
  1211.       @ 16,04 get COMMENT1
  1212.       @ 17,04 get COMMENT2
  1213.       @ 18,04 get COMMENT3
  1214.  
  1215.     ELSE
  1216.  
  1217.       c_temp = "No records in database"
  1218.       GO BOTTOM
  1219.       SKIP
  1220.       @ 02,02 SAY c_temp
  1221.  
  1222.    ENDIF
  1223.  
  1224. RETURN(.T.)
  1225. *** EOF: DISPFLDS() *********************************************************
  1226.  
  1227.